﻿using ZYCommon;
using System;

namespace TextEditor
{
    

    public class A_InsertKeyWord : A_Action
    {
        public override string ActionName()
        {
            return "insertkeyword";
        }

        public override bool Execute()
        {
            if (StringCommon.IsInteger(base.Param1))
            {
                ZYTextKeyWord newElement = new ZYTextKeyWord();
                newElement.Source = StringCommon.ToInt32Value(base.Param1, -1);
                newElement.OwnerDocument = base.myOwnerDocument;
                if (newElement.GetTemplateRecord() != null)
                {
                    base.myOwnerDocument._InsertElement(newElement);
                }
                return true;
            }
            return true;
        }
    }
}

